from typing import Any, TypeVar, Generic, List, Dict, Tuple, Set, Optional

T = TypeVar('T')

class ValidateUtil(Generic[T]):
    @staticmethod
    def is_empty(obj: Optional[T]) -> bool:
        """判断对象是否为空或为 None"""
        if obj is None:
            return True
        if isinstance(obj, (str, list, tuple, set, dict)):
            return len(obj) == 0
        return False

    @staticmethod
    def is_not_empty(obj: Optional[T]) -> bool:
        """判断对象是否不为空且不为 None"""
        return not ValidateUtil.is_empty(obj)

# 示例用法
if __name__ == "__main__":
    # 测试字典
    d: Dict[str, int] = {}
    print(f"Is empty dict: {ValidateUtil.is_empty(d)}")  # 输出: Is empty dict: True

    # 测试非空字典
    d = {'a': 1, 'b': 2}
    print(f"Is not empty dict: {ValidateUtil.is_not_empty(d)}")  # 输出: Is not empty dict: True

    # 测试列表
    l: List[int] = []
    print(f"Is empty list: {ValidateUtil.is_empty(l)}")  # 输出: Is empty list: True

    # 测试非空列表
    l = [1, 2, 3]
    print(f"Is not empty list: {ValidateUtil.is_not_empty(l)}")  # 输出: Is not empty list: True

    # 测试元组
    t: Tuple[int] = ()
    print(f"Is empty tuple: {ValidateUtil.is_empty(t)}")  # 输出: Is empty tuple: True

    # 测试非空元组
    t = (1, 2, 3)
    print(f"Is not empty tuple: {ValidateUtil.is_not_empty(t)}")  # 输出: Is not empty tuple: True

    # 测试集合
    s: Set[int] = set()
    print(f"Is empty set: {ValidateUtil.is_empty(s)}")  # 输出: Is empty set: True

    # 测试非空集合
    s = {1, 2, 3}
    print(f"Is not empty set: {ValidateUtil.is_not_empty(s)}")  # 输出: Is not empty set: True

    # 测试字符串
    st: str = ""
    print(f"Is empty string: {ValidateUtil.is_empty(st)}")  # 输出: Is empty string: True

    # 测试非空字符串
    st = "hello world"
    print(f"Is not empty string: {ValidateUtil.is_not_empty(st)}")  # 输出: Is not empty string: True

    # 测试 None
    none_obj: Optional[Any] = None
    print(f"Is None: {ValidateUtil.is_empty(none_obj)}")  # 输出: Is None: True

    # 测试非空对象
    obj: Any = object()
    print(f"Is not empty object: {ValidateUtil.is_not_empty(obj)}")  # 输出: Is not empty object: True
